<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="css/ui-lightness/jquery-ui-1.8.14.custom.css" rel="stylesheet" type="text/css"/>
<link type="text/css" rel="stylesheet" href="css/jsPlumb.css"/>
</head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
		
<!-- script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.14.custom.min.js"></script-->
<script type="text/javascript" src="js/jquery.jsPlumb-1.3.1-all.js"></script>
<script type="text/javascript" src="js/EndPoints.js"></script>
<!--[if IE]><script src="js/excanvas.js" type="text/javascript" charset="utf-8"></script><![endif]-->
<script language="javascript">
$(document).ready(function(){
	// chrome fix.
	document.onselectstart = function () { return false; };	
	jsPlumb.DefaultDragOptions = { cursor: "pointer", zIndex:2000 };
	jsPlumb.setMouseEventsEnabled(true);
	$("#single_SimSaaS_canvas").append("<div id=\"swindow\" class=\"window\" style=\"top:20em; left:20em;\">A Demo</div>");
	jsPlumb.draggable("swindow");
	var i, offset, start, UUID;
	var num_inputs = 4;
	if(num_inputs > 0)
	{
		offset = 1 / num_inputs;
		start = offset / 2;
	}
	for(i=0; i<num_inputs; ++i)
	{
		UUID = "gs_" + i + "_inputs";
		//alert(UUID);
		//jsPlumb.addEndpoint(wid, $.extend({ anchor:jsPlumb.makeAnchor([0, start + i*offset, -1, 0]) }, NumberEP, {uuid:UUID}));
		var ep = jsPlumb.addEndpoint('swindow', $.extend({ anchor:jsPlumb.makeAnchor([0, start + i*offset, -1, 0]) }, InputEP, {uuid:UUID}));
		//jsPlumb.addEndpoint("swindow", jsPlumb.extend({ anchor:[0, start + i*offset, -1, 0] }, InputEP));
		//jsPlumb.addEndpoint("swindow", { anchor: [0, start + i*offset, -1, 0]}, InputEP);
		//alert(ep.getUuid());
		ep.bind("mouseenter", function(endpoint, event){ alert("mouse enter");});
		//ep.bind("mouseexit", function(endpoint, event){ alert("mouse exit");});
		//ep.bind("click", function(endpoint, event){ alert(endpoint.getUuid());});
	}
});
</script>
<body onunload="jsPlumb.unload();">
<div id="single_SimSaaS_canvas"></div>
</body>
</html>